#include "app_buffer.h"

int main(int argc, char const *argv[])
{

    app_buffer_t *buffer = app_buffer_init(1024);

    app_buffer_write(buffer, "hello world", 11);

    app_buffer_write(buffer, "hello atguigu", strlen("hello atguigu"));

    char tmp_buffer1[20];
    int read_len= app_buffer_read(buffer, tmp_buffer1, 20);
    printf(" tmp_buffer1=%.*s\n", read_len, tmp_buffer1);
    
    char tmp_buffer2[20];
    read_len= app_buffer_read(buffer, tmp_buffer2, 20);
    printf(" tmp_buffer2=%.*s\n", read_len, tmp_buffer2);

    return 0;
}
